package com.manage.competition.util;

import com.manage.competition.entity.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * Create with IDEA
 *
 * @Author: gitee.com/KamisamaXX
 * @Date: Create in 23:23 2019/3/25
 * @Description:
 */
public class CurrentUserUtil {
    public static User getCurrentUser(){
        Subject subject = SecurityUtils.getSubject();
        User user = (User)subject.getPrincipal();
        return user;
    }
}
